import org.apache.catalina.startup.Tomcat;

public class TomcatMain {

	/**
	 * 
	 * @param args
	 * @throws Exception
	 */
	public static void main(String[] args) throws Exception {
		final String CATALINA_HOME = "D:\\hubo\\workspace2.8_demo\\tomcat-server-7.0.2\\";
		Tomcat tomcat = new Tomcat();
		tomcat.setBaseDir(CATALINA_HOME);
		tomcat.setPort(8080);
		tomcat.addWebapp("/", "D:\\hubo\\workspace2.8_demo\\jfreechart\\WebContent\\");
		tomcat.start();
		System.out.println("Started tomcat");
		tomcat.getServer().await(); // Keeps Tomcat running until it is shutdown
	}
}
